{namespace lfe=SGalinski\Lfeditor\ViewHelpers}

<lfe:addJavaScriptFile javaScriptFile="{f:uri.resource(path: 'Scripts/FormUtility.js')}" />
<lfe:addJavaScriptFile javaScriptFile="{f:uri.resource(path: 'Scripts/Lfeditor.js')}" />
<f:if condition="{tinyMCESelected} != 'TRUE'">
	<lfe:addJavaScriptFile javaScriptFile="{f:uri.resource(path: 'Scripts/textareaResize.js')}" />
</f:if>
<lfe:inlineLanguageLabels labels="function.langfile.confirmCancel" />

<lfe:addCssFile cssFile="{f:uri.resource(path: 'StyleSheets/Lfeditor.css')}" />

<f:be.container enableClickMenu="FALSE" loadExtJs="FALSE">
	<div class="typo3-fullDoc">
		<div id="typo3-docheader">
			<div class="typo3-docheader-functions">
				<f:be.menus.actionMenu>
					<f:be.menus.actionMenuItem label="{f:translate(key:'function.general.general')}"
						controller="General"
						action="general" />
					<f:be.menus.actionMenuItem label="{f:translate(key:'function.langfile.edit')}"
						controller="EditFile"
						action="editFile"
						arguments="{buttonType: 0}" />
					<f:be.menus.actionMenuItem label="{f:translate(key:'function.const.edit.edit')}"
						controller="EditConstant"
						action="editConstant" />
					<f:if condition="{defaultLanguagePermission}">
						<f:be.menus.actionMenuItem label="{f:translate(key:'function.const.add.add')}"
							controller="AddConstant"
							action="addConstant" />
						<f:be.menus.actionMenuItem label="{f:translate(key:'function.const.delete.delete')}"
							controller="DeleteConstant"
							action="deleteConstant" />
						<f:be.menus.actionMenuItem label="{f:translate(key:'function.const.rename.rename')}"
							controller="RenameConstant"
							action="renameConstant" />
					</f:if>
					<f:be.menus.actionMenuItem label="{f:translate(key:'function.const.search.search')}"
						controller="SearchConstant"
						action="searchConstant" />
					<f:be.menus.actionMenuItem label="{f:translate(key:'function.const.treeview.treeview')}"
						controller="ViewTree"
						action="viewTree" />
					<f:if condition="{editingMode} == 'extension'">
						<f:be.menus.actionMenuItem label="{f:translate(key:'function.backupMgr.backupMgr')}"
							controller="ManageBackups"
							action="manageBackups" />
					</f:if>
				</f:be.menus.actionMenu>
				<f:if condition="{tinyMCELoaded}">
					<f:be.menus.actionMenu>
						<f:if condition="{tinyMCESelected}">
							<f:then>
								<f:be.menus.actionMenuItem label="{f:translate(key:'select.insertMode.normal')}"
									controller="General"
									action="switchInsertMode"
									arguments="{tinyMCE: 0}" />
								<f:be.menus.actionMenuItem label="{f:translate(key:'select.insertMode.tinyMCE')}"
									controller="General"
									action="switchInsertMode"
									arguments="{tinyMCE: 1}"
									additionalAttributes="{selected: 'selected'}" />
							</f:then>
							<f:else>
								<f:be.menus.actionMenuItem label="{f:translate(key:'select.insertMode.normal')}"
									controller="General"
									action="switchInsertMode"
									arguments="{tinyMCE: 0}"
									additionalAttributes="{selected: 'selected'}" />
								<f:be.menus.actionMenuItem label="{f:translate(key:'select.insertMode.tinyMCE')}"
									controller="General"
									action="switchInsertMode"
									arguments="{tinyMCE: 1}" />
							</f:else>
						</f:if>
					</f:be.menus.actionMenu>
				</f:if>
				<f:if condition="{canChangeEditingModes}">
					<f:be.menus.actionMenu>
						<f:for each="{editingModeOptions}" key="editingModeOption" as="editingModeLabel">
							<f:if condition="{editingMode} == {editingModeOption}">
								<f:then>
									<f:be.menus.actionMenuItem label="{editingModeLabel}"
										controller="General"
										action="switchEditingMode"
										arguments="{editingMode: editingModeOption}"
										additionalAttributes="{selected: 'selected'}" />
								</f:then>
								<f:else>
									<f:be.menus.actionMenuItem label="{editingModeLabel}"
										controller="General"
										action="switchEditingMode"
										arguments="{editingMode: editingModeOption}" />
								</f:else>
							</f:if>
						</f:for>
					</f:be.menus.actionMenu>
				</f:if>
			</div>
		</div>

		<div id="typo3-docbody">
			<div id="typo3-inner-docbody">
				<f:render section="selectItems" />
				<f:flashMessages renderMode="div" />
				<f:render section="main" />
			</div>
		</div>
	</div>
</f:be.container>